package com.zx.idc.backend.gui.sys.login;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.thymeleaf.TemplateEngine;
import org.thymeleaf.context.Context;

/**
 * @author rxliuli
 */
@Service
public class MailContentBuilder {
    @Autowired
    private TemplateEngine templateEngine;

    public String buildVerificationCodeTemplate(String code) {
        final Context context = new Context();
        context.setVariable("code", code);
        return templateEngine.process("mail/verification-code-template", context);
    }
}
